Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
¿Por qué este fragmento de código produce el siguiente error: "user.updateUser is not a function"?

Creé una función general para crear un nuevo usuario con firebase. Se parece a esto:

 export function createUserEmailPassword(email, password, username) { createUserWithEmailAndPassword(auth, email, password) .then((userCredential) => { const user = userCredential.user; user .updateProfile({ displayName: username, }) .then(() => { alert("Welcome " + user.displayName); }); }) .catch((error) => { const errorMessage = error.message; alert(errorMessage); }); }

Por alguna razón, user.updatProfile produce el error: "user.updateProfile no es una función", lo que no me permite configurar el nombre para mostrar.

El objetivo de la función es establecer el nombre de visualización en el nombre de usuario al crear un nuevo usuario.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

updateProfile() es una función de nivel superior en el nuevo SDK de Firebase Modular al igual que createUserWithEmailAndPassword() . Intente refactorizar el código como se muestra a continuación:

 import { updateProfile } from "firebase/auth" createUserWithEmailAndPassword(auth, email, password) .then(async (userCredential) => { const user = userCredential.user; await updateProfile(user, { displayName: username, }) alert("Welcome " + user.displayName); })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!